/*
 * @Author: your name
 * @Date: 2022-01-14 10:08:45
 * @LastEditTime: 2022-01-21 17:07:21
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \code\src\utils\forbid.ts
 */

import { ElMessageBox, ElMessage } from 'element-plus'
import type { Action } from 'element-plus'

const open = () => {
  ElMessageBox.alert('This is a message', 'Title', {
    confirmButtonText: 'OK',
    callback: (action: Action) => {
      ElMessage({
        type: 'info',
        message: `action: ${action}`,
      })
    },
  })
}

// if (process.env.NODE_ENV !== 'development') {
// 禁止右键
document.addEventListener("contextmenu", function () {
  return false;
});
document.oncontextmenu = function () {
  return false;
};
// 禁止 F12
document.onkeydown = function (event) {
  if ((window as any).event.keyCode === 123) {
    return false;
  } else if ((window as any).event.ctrlKey && (window as any).event.shiftKey && (window as any).event.keyCode == 73) {
    return false;
  } else if ((window as any).event.ctrlKey && (window as any).event.shiftKey && (window as any).event.keyCode == 67) {
    return false;
  }
}
// }

